(() => {
    var myChart = echarts.init(document.getElementById('main1'));
    option = {
        // title: {
        //     text: '未来一周气温变化',
        //     subtext: '纯属虚构',

        // },
        // tooltip: {
        //     trigger: 'axis'
        // },
        tooltip: {
            trigger: 'axis',
            // position:['50%','50%'],
            axisPointer: {
                type: 'cross',
                label: {
                    backgroundColor: '#6a7985'
                }
            },
            backgroundColor: 'rgba(0,0,0,0.8)',
            textStyle: {
                color: '#fff'
            },
        },
        legend: {
            data: ['意向', '预购', '成交'],
            left: '5%'
        },
        toolbox: {
            show: true,
            right:'8%',
            orient: 'horizontal',
            feature: {
                // dataZoom: {
                //     yAxisIndex: 'none'
                // },
                // dataView: {readOnly: false},
                magicType: {
                    type: ['line', 'bar', 'stack', 'tiled'],
                    title: {
                        line: '切换为折线图',
                        bar: '切换为柱状图',
                        stack: '切换为堆叠',
                        tiled: '切换为平铺'
                    },
                   
                },
                restore: {
                    title: '还原'
                },
                // saveAsImage: {}
            }
        },
        xAxis: {
            type: 'category',
            boundaryGap: false,
            data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
        },
        yAxis: {
            type: 'value',
            // axisLabel: {
            //     formatter: '{value} °C'
            // }
        },
        series: [

            {
                name: '意向',
                type: 'line',
                // stack: '总量',
                areaStyle: {},
                // // emphasis: {
                // //     focus: 'series'
                // // },
                data: [1300, 1110, 540, 260, 340, 100, 10],
                color: '#F07050'
            },
            {
                name: '预购',
                type: 'line',
                // stack: '总量',
                areaStyle: {},
                emphasis: {
                    // focus: 'series'
                },
                data: [10, 125, 350, 800, 400, 30, 10],
                color: '#80C0F0'
            },
            {
                name: '成交',
                type: 'line',
                // stack: '总量',
                areaStyle: {},
                emphasis: {
                    // focus: 'series'
                },
                data: [4, 20, 40, 80, 250, 800, 740],
                color: '#D070D0'
            },
        ]
    };
    myChart.setOption(option)
})()